Skip to content

Remove native chmod tool execution in tests #173

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 1, 2021

Conversation

plamentotev
Copy link
Member

Runtime.getRuntime().exec( "chmod 440 " + causes
security warnings because it concatenates arguments
(there is a risk of argument injection).

The argument does not come from untrusted source,
but as we can use Java to change a file mode, it is
better to remove the chmod invocation altogether.
chmod was necessary before Java 7 as there
was no support for changing file modes.

`Runtime.getRuntime().exec( "chmod 440 " + ` causes
security warnings because it concatenates arguments
(there is a risk of argument injection).

The argument does not come from untrusted source,
but as we can use Java to change a file mode, it is
better to remove the `chmod` invocation altogether.
`chmod` was necessary before Java 7 as there
was no support for changing file modes.
@plamentotev plamentotev added this to the plexus-archiver-4.2.6 milestone May 1, 2021
@plamentotev plamentotev merged commit 526b859 into master May 1, 2021
@plamentotev plamentotev deleted the fix-security-warnings branch May 1, 2021 15:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant